/** * 页面 */
<template>
  <view>
    <u-card
      :title="item.contractName"
      :sub-title="item.createTime + ' ' + item.status_dictText"
      v-for="(item, index) in taskList"
      :key="index"
      @click="gotoDetail(item)"
    >
      <view class="" slot="body">
        <view>
          <view class="u-font-25">
            <view class="u-body-item-title u-line-2">{{
              item.contractOrigin_dictText || "无"
            }}</view>
          </view>
        </view>
      </view>
    </u-card>
  </view>
</template>

<script>
// 引入封装好的网络请求
import hetongApi from "../../api/hetong.js";
export default {
  mounted() {
    this.token = this.$store.state.token;
    this.getTaskList();
  },
  data() {
    return {
      // 搜索框双向绑定
      keyword: "",
      pageSize: 10,
      pageNo: 1,
      // tab栏列表
      token: "",
      // 审核列表
      taskList: [],
      current: 0,
      title: "素胚勾勒出青花，笔锋浓转淡",
      subTitle: "2020-05-15",
      thumb: "http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg",
    };
  },

  onReachBottom() {
    this.getTaskList();
  },
  methods: {
    getTaskList() {
      hetongApi
        .getHeTongList(
          {
            "X-Access-Token": this.$store.state.token,
          },
          {
            pageNo: this.pageNo++,
            pageSize: this.pageSize,
            column: "createTime",
            order: "desc",
            status: 3,
          }
        )
        .then((res) => {
          console.log(res);
          this.taskList.push(...res.data.result.records);
        });
    },
    change(index) {
      this.current = index;
      this.getTaskList();
    },
    // 跳转到详情页面的回调函数
    gotoDetail(item) {
      this.$Router.push({
        path: "/pages/hetongDetail/hetongDetail",
        query: { obj: item, current: this.current },
      });
    },
  },
};
</script>

<style lang="scss">
.u-card-wrap {
  background-color: $u-bg-color;
  padding: 1px;
}

.u-body-item {
  font-size: 32rpx;
  color: #333;
  padding: 20rpx 10rpx;
}

.u-body-item image {
  width: 120rpx;
  flex: 0 0 120rpx;
  height: 120rpx;
  border-radius: 8rpx;
  margin-left: 12rpx;
}
</style>
